#ifndef __VECTOR_3D_H__
#define __VECTOR_3D_H__

#define DREAMPORT2_PI		 3.141592653589793238462643383280
#define DEGREE_TO_RADIAN	 0.017453292519943295769236907685
#define RADIAN_TO_DEGREE	57.295779513096787811588376533861

#define TO_RADIAN(degree)	degree * DEGREE_TO_RADIAN
#define TO_DEGREE(radian)	radian * RADIAN_TO_DEGREE

class Vector3D
{

private:

        double _x;
        double _y;
        double _z;

        float _red;
        float _green;
        float _blue;

        unsigned int _track_id;

public:
        inline void setTrackId(unsigned int track_id){_track_id = track_id;}
        inline unsigned int getTrackId(){return _track_id;}
        inline void setColor(float r, float g, float b) { _red = r; _green = g; _blue = b; }
        inline float getRed() const { return _red; }
        inline float getGreen() const { return _green; }
        inline float getBlue() const { return _blue; }

        inline double getX() const	{ return _x; }
        inline void setX(double value)	{ _x = value; }

        inline double getY() const	{ return _y; }
        inline void setY(double value)	{ _y = value; }

        inline double getZ() const	{ return _z; }
        inline void setZ(double value)	{ _z = value; }

public:

        Vector3D(void);
        Vector3D(double x, double y, double z);
        virtual ~Vector3D(void);

        virtual double           getL2Distance() const;
        Vector3D		normalize() const;
        Vector3D		operator+(const Vector3D & v) const;
        Vector3D		operator-(const Vector3D & v) const;
        Vector3D		operator*(double scalar) const;

        double			dotProduct(const Vector3D & v) const;
        Vector3D		crossProduct(const Vector3D & v) const;

        static double	DotProduct(const Vector3D & u, const Vector3D & v);
        static Vector3D CrossProduct(const Vector3D & u, const Vector3D & v);

        static Vector3D getLinearCurve(const Vector3D & p1, const Vector3D & p2, double t);

};

typedef Vector3D Point3D;

#endif // __VECTOR_3D_H__
